<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>选项合并</title>
  <script src="vue.js"></script>
</head>
<body>
<script>
  var mixin = {
    methods: {
      main1: function () {
        console.log('main1')
      },
      conflicting: function () {
        console.log('from mixin')
      }
    }
  }
  var vm = new Vue({
    mixins: [mixin],
    methods: {
      main2: function () {
        console.log('main2')
      },
      conflicting: function () {
        console.log('from self')
      }
    }
  })
  vm.main1() // -> "main1"
  vm.main2() // -> "main2"
  vm.conflicting() // -> "from self"
</script>
</body>
</html>